<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>ABCD Instruction</title>
<link href="../edit68k.css" rel="stylesheet" type="text/css">
</head>

<body>
<h1 class="heading">ABCD Instruction<BR>
</h1>
<hr noshade></h1>
        <P align=left><BR>
          <span class="text">Adds two bytes in BCD-form (Binary Coded Decimal). The destination operand is replaced with the sum of the source and the destination operand.<BR>
          <BR>
  ADDRESS METHODS: Dn, -(An)<BR>
          <BR>
  Only two methods are allowed:<BR>
  <BR>
  1. Add data register to another data register (Dn to Dn)<BR>
          <BR>
  2. Add memory to memory. This is used when you add BCD numbers stored in many bytes. You must start at the highest address (the least significant byte in the BCD number) and go upwards. The X flag is set if the addition results in a carry, which is added to the next byte.<BR>
          <BR>
  DATA LENGTH: Byte</span></P>
        <TABLE border=0 cellPadding=0 cellSpacing=0 width="67%">
          <TBODY>
            <TR>
              <TD width="14%" rowSpan=5 vAlign=top class="text">FLAGS:</TD>
              <TD width="86%" class="text">X - Set if carry from the most significant BCD digit.</TD>
            </TR>
            <TR>
              <TD width="86%" class="text">N - undef</TD>
            </TR>
            <TR>
              <TD width="86%" class="text">Z - Cleared if the result is NOT zero. Unaffected else.</TD>
            </TR>
            <TR>
              <TD width="86%" class="text">C - Same as X</TD>
            </TR>
            <TR>
              <TD width="86%"><span class="text">V - undef </span>
                  <P>&nbsp;</P></TD>
            </TR>
          </TBODY>
        </TABLE>
        <TABLE border=0 cellPadding=0 cellSpacing=0 width="68%">
          <TBODY>
            <TR>
              <TD width="24%" rowSpan=2 class="text">SYNTAX:</TD>
              <TD width="76%" class="text">ABCD Dx,Dy</TD>
            </TR>
            <TR>
              <TD width="76%" class="text">ABCD -(Ax),-(Ay)</TD>
            </TR>
          </TBODY>
        </TABLE>
<P align=left><span class="text"><strong style="font-weight: 400">EXAMPLE CODE:</strong></span></P>
<P align=left class="sourcecode"><strong style="font-weight: 400">
<font face="Arial" size="2">&nbsp;&nbsp; ABCD.B&nbsp;&nbsp;&nbsp; D0,D1&nbsp;&nbsp;&nbsp; 
 
Adds the 2 BCD numbers in D0 and D1 and stores the answer in D1</font></strong></P>
        <P align=left><span class="text"><STRONG></STRONG></span><STRONG class="subheading"></STRONG></P>
        <H3 align=left></H3>
<span class="text">
  </span>
</body>
</html>